#include <stdio.h>

int main(int argc, char**argv)
{
    FILE* fp1 = fopen(argv[1], "w+");
    if(fp1 == NULL)
    {
        perror("fopen 1 error:");
        return -1;
    }
    int a[11];
    for(int i = 0; i < 11; i++)
    {
        scanf("%d", &a[i]);
    }
    int re = fwrite(a, 4, 11, fp1);
    printf("re = %d\n", re);

    int num[11] = {0};
    fseek(fp1, 0, SEEK_SET);
    re = fread(num,4,11,fp1);
    perror("");
    printf("re = %d\n", re);
    for(int i = 0; i < 11; i++)
    {
        printf("%d ", num[i]);
    }
    printf("\n");
    fclose(fp1);

}
    